{
 "cells": [
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Option pricing problem\n",
    "\n",
    "*Copyright (c) 2022 Institute for Quantum Computing, Baidu Inc. All Rights Reserved.*"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The task of option pricing is to assess the expected value of the current stock option at the expiration date. Many factors determine the value of an option, including the current stock price, intrinsic value, time to maturity or time value, volatility, interest rates, and cash dividends paid. Many option pricing models use these factors as parameters to determine the fair market value of an option, the most widely known of which is the Black-Scholes model. The Black-Scholes model can price a variety of financial derivatives through a simple and analytically solvable model with a small number of input parameters. The model assumes that the prices of a large number of traded assets follow geometric Brownian motion with constant drift and volatility. When applied to stock options, the model contains a constant price change for the stock, the time value of the currency, the strike price of the option, and the time the option expires. In particular, instruments such as stocks or futures contracts will have a lognormally distributed price after a random walk, with constant drift and volatility. \n",
    "\n",
    "European option pricing is a direct application of the Black-Scholes model, which can be used to calculate the price of a European call option. Europeans call options give the option holder the right to purchase shares at a pre-agreed price of $K$ at $T$ on the expiration date. Typically, the option payoff function is given by\n",
    "$$\n",
    "f(S_{T})=\\max\\{0, S_{T}-K\\}, \\tag{1}\n",
    "$$\n",
    "where $S_{T}$ represents the asset price at the expiration date of the option and $K$ represents the strike price. Here, the asset price $S_{T}$ follows a known probability distribution under the Black-Scholes model and depends on the initial price, risk-free interest rate, volatility, and maturity date $T$. In classical calculations, the expected value of an option's stock at maturity can be calculated by Monte Carlo methods: a market sample is taken from a known (risk-neutral) probability distribution, and then the asset price given that market sample is calculated. Afterwards, the payoff of the option for a given asset price is calculated, and finally, averaging payoffs overall multiple samples gives an approximation of the option price."
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Quantum solutions\n",
    "Unlike classical algorithms, the core of the quantum Monte Carlo method is to simulate probability distributions with quantum circuits and store asset prices in quantum states, and then calculate the average of returns in parallel through quantum amplitude estimation algorithms. Through the characteristics of quantum superposition and entanglement, quantum schemes have the advantage of quadratic acceleration compared with classical schemes. Next, we take a European call option as an example to show how to use Paddle Quantum to simulate this quantum scheme to complete the risk-neutral pricing problem of European call options."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Online demonstration"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We have set a parameter that can be used directly for the pricing of European call options. Just configure it in the configuration file `config.toml` and enter the command \n",
    "`python euro_pricing.py --config config.toml`\n",
    "The configured European options can be priced.\n",
    "\n",
    "Here, we give a version of the online demo that can be tested online. First define the contents of the configuration file:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "euro_toml = r\"\"\"\n",
    "# The overall profile used to calculate the option pricing model\n",
    "# initial price\n",
    "initial_price = 100\n",
    "# strike price\n",
    "strike_price = 110\n",
    "# risk-free rate\n",
    "interest_rate = 0.05\n",
    "# Market volatility\n",
    "volatility = 0.1\n",
    "# Option expiration date (in years)\n",
    "maturity_date = 1\n",
    "# Estimation accuracy index\n",
    "degree_of_estimation = 5\n",
    "\"\"\""
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The financial module of the Paddle Quantum enables numerical simulation of quantum Monte Carlo schemes. We can import ``EuroOptionEstimator`` from the ``paddle_quantum.finance`` module to solve the configured option pricing problem."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The risk-neutral price of the option is approximately  2.2613329887390137\n",
      "The following is a circuit implementation diagram of this quantum scheme.\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAABDwAAAUbCAYAAADCtLDZAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8qNh9FAAAACXBIW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AA9TT6m1AwQvAAAADK8PTTT8eKFSvikUceidbW1njZy14WO+ywQ6PHglQEjzEYDh4zZ86MOXPmjHr88Pt3zJ49O9ra2mo5GgAAMAGsX78+Lr/88rj88svjl7/85cj3d9xxx3jXu94VS5YsiXnz5jVwQsjDJS1VKooi7r333oio/g1Lh1/h4dUdAABAX19fHHTQQXHmmWduEjsiIgYGBuILX/hCLFy4MG655ZYGTQi5eIVHlVavXh0DAwMRETFr1qxYtmzZqLe5//77I0LwAACAyW5gYCAOO+ywkecIm/PYY4/Fm9/85viXf/mXWLRoUZ2mg5wEjypt/P4dS5cujaVLl1Z9W8EDAAAmt6985Stx3333VXXsE088EZ/4xCfipptuqvFUkJtLWqq0cfAYK8EDAAAmr2eeeSYuu+yyMd3m5ptvjtWrV9doIpgcSn+FR19fX9mn3CqVSqXU8w0Hj6lTp8bAwEBMmzZti8efccYZcfHFF0dra2vstddepcxQ9n8TAABQe6tWrYoHH3xwzLf7xje+ESeddFINJhr/PPepn/F0X3d0dJR6vtKDR2dnZ9mnHBeGg8c+++wzauyIiLjrrrsi4o9vcDplSjkvpOnq6irlPAAAwPh3zjnnxDnnnNPoMUhuPD3PLIqi1PO5pKUKa9eujTVr1kRExMKFC0c9viiKuOeeeyLC5SwAAADQCKW/wqO3t7fsU26VSqVSWqna+P07qnmn5FWrVsX69esjotzg0d3dHe3t7aWdDwAAqL0nn3wyDjzwwFi7du2Ybvf9738/9t9//xpNNb6V+XyOLcv8PLP04FH2NTfjwViDx/DlLBHlBo/29vaU9y8AAGR38sknx/nnn1/18YsWLYojjzwympqaajgV5H6e6ZKWKgwHj+bm5liwYMGoxw8HjylTplR1PAAAkNupp54au+66a9XHn3322WIHbCPBowrDwWP+/PkxY8aMUY+/++67IyJi3rx50draWsvRAACACWDOnDlxww03xC677DLqsZdeemm86U1vqv1QkJzgMYrBwcFYuXJlRFR3OUvEn4OHNywFAACGHXjggbFs2bI45phjoqXlue8ucPDBB8f1118fp512WgOmg3wEj1H09PTE0N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Na14TEREnnnjiyPcOOeSQWtx9E1baV3gAAADA97///ViyZEn86le/es6v9fb2Rm9vb3zve9+LCy64IK677rrYY489nvc8y5cvr/r3/Ku/+qv4+te/vpUT//kcz/bWt741XvziF0dExAMPPBDnn39+nHzyyfGqV70qIiJmz569Tb9nNoIHAAAAKZ111lnxj//4jxERsdtuu8X73//+OOyww2LPPfeMoijigQceiCuuuCL+1//6X7F8+fJ45StfGXfddddzwsHg4GCsXLkyIiKWLFkS55133hZ/3x122CFuvPHG533VyKpVq2L//fePiIhzzz03TjvttOc9x/Tp05/zvQULFsSCBQsi4o9vWnr++efHQQcdFMcff/wo98TkJHgAAACQzplnnhkXXHBBREQcddRR8ZWvfCV22mmnTY7Zbbfd4tWvfnUsXrw4PvjBD8aaNWvi1FNPjWuvvXaT43p6emJoaCgi/hgddthhh1F//9bW1uf9/qpVq0a+Xrx4cVXnYut4Dw8AAABSue6660Zix9ve9rb4zne+85zYsbHTTz995D0xrrvuunjwwQc3+fWNL2fZe++9t2m2n/3sZyNfv/zlL9+mc7FlggcAAABpPPzww/G+970vIiL+8i//Mq688sqYMmX0p74nnXRSREQURRE333zzJr9Wi+Cx2267RVtb2zadiy0TPAAAAEjj4osvjt/97ncREXHRRRfF9ttvX9XtFi9ePPJ1T0/PJr82HDxmz54dM2fO3Kb5hoOHV3fUnuABAABAChs2bIjLL788IiL22WefeNOb3lT1bWfNmjXy9cMPPzzydVEUce+990bEtr+6Y926dfHrX/86IgSPevCmpQAAAKTwgx/8IB555JGIiHjnO98ZTU1NVd/2iSeeGPl6u+22G/l69erVMTAwEBERc+fOjccee2yz59h+++23+Ht6/4768goPAAAAUrjllltGvn7DG94wptuuWbNm5OsXvOAFI19v/P4d//zP/xw77rjj8/5vl1122SSaPB/Bo74EDwAAAFIYDgrTp0+P+fPnj+m2d95558jXG8eIjYPHlsyfP3+zH0X77Pm22267eOlLXzqm+Z5txowZMXfu3C1++sxk55IWAAAAUujv74+IP765aHNz85hue+ONN458/cpXvnLk6+HgMW3atBgYGIipU6du9XzDwWP+/PnbdJ6IiAMOOCBWrVq1TefIzis8AAAASGHDhg0R8cdXeIxFX19f3HbbbRERsWjRok1efTEcPBYsWLBNkeLpp5+O++67LyJczlIvggcAAAApDH/SyqOPPjqm21144YUxNDQUERFLliwZ+f7atWtH3ttj0aJF2zTbypUrY3BwMCIEj3oRPAAAAEjhZS97WURE/O53v4u+vr6qbrNixYr44he/GBER+++/fxx//PEjv7bx+3dsa/DwhqX1J3gAAACQwuGHHz7y9Ve/+tVRj3/44Yfj6KOPjqeeeipaW1vj61//ekyZ8uenyYLHxCZ4AAAAkMKxxx4bc+bMiYiIz3zmM5t88sqz/fznP49DDjkkVq5cGc3NzXHllVeOvEJk2MZvWPrsXxur4eAxZ86c2HXXXbfpXFRH8AAAACCFadOmxTe+8Y1oaWmJJ554Ig455JA4++yz42c/+1k88sgj0d/fH7feemuccsopse+++0ZPT0+0trbGd77znTj66KOfc77h4LHvvvtu86eqDAcPr+6oHx9LCwAAQBqHHHJI3HTTTXHcccfFQw89FOeee26ce+65z3vsq1/96rjiiiti3rx5z/m1wcHBWLlyZURs++UsDz30UFQqlYgQPOrJKzwAAABI5XWve1384he/iEsuuSRe97rXRVtb23NeofH1r389fvSjHz1v7IiI6OnpGfnkFu/fMTF5hQcAAADp7LDDDnH66afH6aefPvK9f//3f4/FixfH448/Hpdffnn87d/+bbS0PP/T4sWLF0dRFKXM8rrXva60c1E9r/AAAABgUnjpS18aX/jCFyIi4t/+7d/i7LPPbvBE1FLaV3gMDQ1Ff39/o8coVVtb22brIwAAAKM74YQT4tZbb41vfOMb8Y//+I/xmte8Jv7mb/6m0WNRA2mfPff390dnZ2ejxyhVb29vdHR0NHoMAACACe2qq66Kq666qtFjUGMuaQEAAADSSfsKj411d3dHe3t7o8fYKpVKJbq6uho9BgAAAEwokyJ4tLe3uxQEAAAAJhGXtAAAAADpCB4AAABAOoIHAAAAkI7gAQAAAKQjeAAAAADpCB4AAABAOoIHAAAAkI7gA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nhjj42IiHvvvXeT75988snx2c9+Nv7jP/4jfv/738eZZ54ZRx55pDcsHQfGusunn346BgcHR65BHhwcjMHBwZrPSXXGus9LL700zjnnnLj11ltjv/32q8OEVGssu9ywYUNcccUV8cgjj0RExOrVq+Oss86KV73qVT7lYxwYyy7f/va3x+rVq2P58uWxfPny+D//5/9ERMQPf/jDeMc73lGXedm8sf4d++1vf3vkFa4rVqyIs88+O44++uiazwkTjU9pIaVTTjklHnnkkZH3eGDiW7NmTUREzJ49e5Pvn3XWWfHII4/EokWL4g9/+EMceuih8aUvfakRI1Klze3yqquu2uQjhWfMmBER4WXz49zm9vnBD34wpk6dGgcddNAm33/sscfqNhtj83y7bGpqiu9+97vx0Y9+NJ544onYdddd47DDDvN+LOPc8+2ytbV1k0g1NDQUERHt7e2xww471HdAqra5v2Mvu+yyeN/73hdPPfVUtLW1xbHHHhuf+MQnGjEijGuCB+lcffXVcd1110VECB7jzIYNG6KpqWnkiexYnH322RERmzwhjohobm6Oiy66KC666KJSZqQ6tdjlCSecECeccEIZ4zFGtdinUNUYZe9yxowZ8X//7/8tbT6qV4ufy43tsccefk7rpBa7/PGPf1zKbJCdS1pI5Xe/+1184AMfGPm/fVJHYz355JNx5ZVXxuGHHx677LJLbL/99tHa2hq77rprvP3tb4+f/vSnVZ3n/PPPj2uvvTbe/OY3x7ve9a4aT83zsctc7DMPu8zDLvOwSxhHGvweIowjGd6E6G1ve1vx1re+deS/4/3vf3+jR9rEZHrTrqVLlxadnZ3FoYceWnz3u98tent7i8HBweLnP/95cdpppxVNTU3FlClTii996UtbPM+ll15aRERxyCGH1PQN8sZqMr2hnl1OzN9rczLv0y7tcrz/XpuTeZdF4fGPXULjCB6MmOh/gX3nO98pXvSiFxW//e1vR/47/u7v/q7RY21iMvyDPzQ0VJx11lnFjBkzim9+85ubPe5Tn/pUERFFc3NzcccddzzvMRdddFEREcVrX/vacfWPfVFMjgfjdjmxf69nmwz7tMtN2eX4+72ebTLssig8/tmYXUJ9CR6MmMh/gT300EPF7Nmzix/+8IdFURTFlClTiogo3vKWtzR4sk1l/wf/mWeeKY466qiiubm5uOGGG7Z47Pr164vtttuuiIji9a9//XN+/bOf/WwREcVhhx1WPPHEE7UaeatlfzBulxP/99rYZNmnXW7KLsff77WxybLLovD4Z2N2CfUleDBiIv8FdswxxxSnnHLKyP+94447FhFRvO51r2vgVM+V/R/8//bf/lsREcVZZ51V1fEHHnhgERFFS0tLsX79+pHvn3feeUVEFEceeWQxODhYq3G3SfYH43Y58X+vjU2Wfdrlc9nl+Pq9NjZZdlkUHv88m11C/fiUFia86667Lu68885NPp98hx12iIGBAZ/SUke33357fOpTn4rZs2fHOeecU9Vt/vIv/zKWLVsWQ0NDsWrVqth///3jn/7pn+LjH/94zJ49O9761rfGNddc85zbHX/88SVPz8bsMhf7zMMu87DLPOwSxjfBgwntkUceife///1x9dVXx/bbbz/y/eGvBY/6KIoi/st/+S/xzDPPxPve976YNm1aVbfbcccdR75+4oknIiLizjvvjIiI3/72t/Hud7/7eW/nH/zasctc7DMPu8zDLvOwSxj/fCwtE9oHPvCBOProo+Ov//qvN/m+4FFf/+///b9Yvnx5REQcccQRW3WOXXfdNSIirrzyyij+eLndZv9H7dhlLvaZh13mYZd52CWMf17hwYT1/e9/P7q7u2PZsmXx2GOPbfJr06dPj4iI9evXN2K0SWfp0qUREdHc3BwLFy6s+naPPvpoRETMmDEj5s6dW4vRGCO7zMU+87DLPOwyD7uE8U/wYEJ6+OGH433ve19MnTo1Zs+eHU8//fTzHvfsEEJt3H333RERMWvWrGhubq76dj09PRER8dd//dfR0uKvo/HALnOxzzzsMg+7zMMuYfxzSQsT0rvf/e54/etfH7/61a9iaGjoOS/5O/zwwyMi4umnn47HH3+8wdPm99BDD435NmvWrIkHHnggImKz16pSf3aZi33mYZd52GUedgnjn+DBuLZ+/fq44YYbNnmlxic/+cl44IEH4rLLLtvs7WbNmjXy9Zo1a2o6IxG77bZbRPzxH/5Vq1ZVdZvLL788iqKIBQsWxNve9rZajscY2GUu9pmHXeZhl3nYJYx/ggfj2jvf+c74z//5P8dxxx0XDz/8cJx55plxwQUXxLe+9a1NPpXl2V784hePfH3rrbdGRMT9998ffX19NZ95MnrjG9848vWSJUviqaeees4xg4ODI+9E3tvbG5dccklMnTo1rrjiipgyxV9F44Vd5mKfedhlHnaZh13C+OenjHHtN7/5TUREXH/99fGCF7wgLrjggvjSl74UixYt2uLt/uZv/mbk67POOive+MY3xlve8pbYbrvtajrvZHXKKafEQQcdFBERN910U7ziFa+I73znO7FixYpYtmxZXHLJJXHMMcdEpVKJJ598Mo477rjYsGFD/NM//VN0dXU1eHo2Zpe52GcedpmHXeZhlzABFPAnvb29RUQUEVH09vY2epyiKIri6quvLlpaWoqIKGbMmFFcccUVVd/2k5/8ZLHzzjsXO+20U/GmN72pWL16dQ0nrU697uNG7HLDhg3FeeedV+y7775Fa2trMWPGjGLPPfcsjjnmmOKaa64pnnrqqWLdunXF4YcfXmy33XbFl7/85brMVSv1vI/rvU+7zPF7DZtM+7RLuxzvv9ewybTLovD4xy6hcQQPRozXv8AefPDB4tprry3WrFnT6FG2WeZ/8Ldk3bp1xRVXXFF0dnYWixcvLn760582eqRtlv3B+ObY5cT5vaqRbZ92aZfj/feqRrZdFoXHP3YJjeNzkBj35s2bF/PmzWv0GFSpv78/fvrTn8bPfvazWLFiRaxcuTIeeOCBePWrXx2f//zn481vfnM0NTU1ekyqYJe52GcedpmHXeZhlzA+CR7ANhsaGorzzz8/rr/++rjrrruiKIqRXzv66KPjhhtuiDlz5mz29j/4wQ/i8ccfjze/+c11mJYtsctc7DMPu8zDLvOwSxj/vGkpsM2amppir732ir/927+NY489NnbfffeRX7vmmmtir732ir/7u7+LH/7wh/H0009vctt77703zj333DjssMPqPTbPwy5zsc887DIPu8zDLmH88woPYJs1NzfHscceu8n3uru741vf+lZ85zvfid/85jdx1VVXxVVXXRUzZ86MAw44IF7wghfEr371q/iP//iPuOGGG2L69OkNmp6N2WUu9pmHXeZhl3nYJYx/ggdQ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cEDAAAASEfwAAAAANJpafQAjE+VSqXRI6TUiPvVLmujUferfZbPLvOwyzzsMhePf/JwvzLRCB48r66urkaPQEnsMhf7zMMu87DLPOwyD7sEIlzSAgAAACTUVBRF0eghGB+Ghoaiv7+/0WNMGm1tbdHSUpsXWdllfdVylxH2WU92mYdd5mGXuXj8k0etfzahDIIHAAAAkI5LWgAAAIB0BA8AAAAgHcEDAAAASEfwAAAAANIRPAAAAIB0BA8AAAAgHcEDAAAASEfwAAAAANIRPAAAAIB0BA8AAAAgHcEDAAAASEfwAAAAANIRPAAAAIB0BA8AAAAgHcEDAAAASEfwAAAAANIRPAAAAIB0BA8AAAAgHcEDAAAASEfwAAAAANIRPAAAAIB0BA8AAAAgHcEDAAAASEfwAAAAANIRPAAAAIB0BA8AAAAgHcEDAAAASEfwAAAAANIRPAAAAIB0BA8AAAAgnf8PPbJ4Qqo3g8AAAAAASUVORK5CYII=",
      "text/plain": [
       "<Figure size 1088x1320 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import os\n",
    "import warnings\n",
    "warnings.filterwarnings(\"ignore\")\n",
    "os.environ['PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION'] = 'python'\n",
    "\n",
    "import toml\n",
    "from paddle_quantum.finance import EuroOptionEstimator\n",
    "\n",
    "config = toml.loads(euro_toml)\n",
    "initial_price = config[\"initial_price\"]\n",
    "strike_price = config[\"strike_price\"]\n",
    "interest_rate = config[\"interest_rate\"]\n",
    "volatility = config[\"volatility\"]\n",
    "maturity_date = config[\"maturity_date\"]\n",
    "degree_of_estimation = config[\"degree_of_estimation\"]\n",
    "\n",
    "\n",
    "estimator = EuroOptionEstimator(initial_price, strike_price, interest_rate, volatility, maturity_date, degree_of_estimation)\n",
    "print(\"The risk-neutral price of the option is approximately \", estimator.estimate())\n",
    "print(\"The following is a circuit implementation diagram of this quantum scheme.\")\n",
    "estimator.plot()"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "By modifying the contents of the configuration file and running the prediction code, you can test the model online."
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "___\n",
    "\n",
    "# Note\n",
    "\n",
    "The models presented here are only intended to solve the option pricing problem of the Black-Scholes model.\n",
    "\n",
    "# Citation\n",
    "\n",
    "```\n",
    "@article{rebentrost2018quantum,\n",
    "  title = {Quantum Computational Finance: {{Monte Carlo}} Pricing of Financial Derivatives},\n",
    "  shorttitle = {Quantum Computational Finance},\n",
    "  author = {Rebentrost, Patrick and Gupt, Brajesh and Bromley, Thomas R.},\n",
    "  year = {2018},\n",
    "  month = aug,\n",
    "  journal = {Physical Review A},\n",
    "  volume = {98},\n",
    "  number = {2},\n",
    "  pages = {022321},\n",
    "  publisher = {{American Physical Society}},\n",
    "  doi = {10.1103/PhysRevA.98.022321},\n",
    "  url = {https://link.aps.org/doi/10.1103/PhysRevA.98.022321},\n",
    "}\n",
    "```\n",
    "\n",
    "# References\n",
    "\n",
    "[1] Rebentrost, Patrick, Brajesh Gupt, and Thomas R. Bromley. \"Quantum computational finance: Monte Carlo pricing of financial derivatives.\" Physical Review A 98.2 (2018): 022321."
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "pq",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.13 (default, Mar 28 2022, 06:16:26) \n[Clang 12.0.0 ]"
  },
  "orig_nbformat": 4,
  "vscode": {
   "interpreter": {
    "hash": "08942b1340a5932ff3a93f52933a99b0e263568f3aace1d262ffa4d9a0f2da31"
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
